package com.bsoft.exchange.controller.clinicMedication;

import com.bsoft.exchange.pojo.RecordsPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.MedicaladviceRosteringService;
import com.bsoft.exchange.util.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 创建日期 : 2019/12/17
 * 创建人 : 赵太行
 */
@RestController
@RequestMapping(value = "medicaladvice")
public class MedicaladviceRosteringController {
    @Autowired
    MedicaladviceRosteringService medicaladviceRosteringService;
    /**
     * 获取就医记录
     */
    @RequestMapping(value = "/getRecords",method = RequestMethod.POST,produces = "application/json" )
    public ResponseEntity getRecords(@RequestBody @Validated RecordsPojo recordsPojo){
        ResponseEntity responseEntity=new ResponseEntity();
        BaseResponse baseResponse=medicaladviceRosteringService.getRosteringList(recordsPojo);
        responseEntity.setCode(baseResponse.getCode());
        responseEntity.setMessage(baseResponse.getMessage());
        responseEntity.setData(baseResponse.getData());
        return  responseEntity;
    }
}
